<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>供需对接服务系统--我的项目</title>
	<!--公用样式-->
	<link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/comment.css"/>
	<link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/supplier/common/css/style.css"/>
	<!--Layui-->
	<link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
	<!--extended-->
	<link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/extended.css"/>
	<!--公用样式JS-->
	<script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
	<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.js" charset="utf-8"></script>
</head>
<style>
	.Right {
		width: 100%;
		overflow-y: scroll;
	}

</style>

<body>
<!--头部-->

<!--容器-->
<div class="container clearfix">
	<!--右侧内容-->
	<div class="Right fr mt10">
		<div class="screening screeningOne whitebg clearfix">
			<ul class="clearfix fl"  style="width: 85%;">
				<ul class="clearfix fl"  style="width: 85%;">
					<li  style="width: 17%;">
						<div>项目类型</div>
						<select name="projectType" id="projectType">
							<option value="">全部</option>
							<#list projectTypeList as vo>
								<option value="${vo.badtCode}">${vo.badtName}</option>
							</#list>
						</select>
					</li>
					<li style="margin-left: 10px;width: 18%;">
						<div>项目名称</div>
						<input type="text" name="projectName" id="projectName" placeholder="请输入项目名称" style="width: 90%;border: 1px solid #EEEEEE;" autocomplete="off">
					</li>
					<li style="margin-left: 10px;width: 18%;">
						<div>发布单位</div>
						<input type="text" name="pubCompanyName" id="pubCompanyName" placeholder="请输入发布单位" style="width: 90%;border: 1px solid #EEEEEE;" autocomplete="off">
					</li>
					<li style="margin-left: 10px;width: 18%;">
						<div>中标人</div>
						<input type="text" name="zbPersonName" id="zbPersonName" placeholder="请输入中标人" style="width: 90%;border: 1px solid #EEEEEE;" autocomplete="off">
					</li>
					<li style="margin-left: 10px;width: 18%;">
						<div>中标单位</div>
						<input type="text" name="zbCompanyName" id="zbCompanyName" placeholder="请输入中标单位" style="width: 90%;border: 1px solid #EEEEEE;" autocomplete="off">
					</li>
				</ul>
			</ul>
			<div class="fl mt30">
				<button type="button" class="bluebg white"  style="width: 120px;" onclick="query()">筛选</button>
			</div>
		</div>

		<div class="project whitebg">
			 <table id="tableList" class="layui-hide" lay-filter="tableList"></table>
		</div>
	</div>
</div>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/tabs.js"></script>
<script type="text/javascript">
	var layer;
	var form = layui.form;
	var table = null;
	var tableIns = null;
	//注意进度条依赖 element 模块，否则无法进行正常渲染和功能性操作
	var element = "";
	layui.use('element', function () {
		element = layui.element;
	});
	layui.use('laydate', function () {
		var laydate = layui.laydate;
		//执行一个laydate实例
		laydate.render({
			elem: '#beginDate' //指定元素
		});
		laydate.render({
			elem: '#endDate' //指定元素
		});
	});



	function query() {
		var projectName = $('#projectName').val();
		var projectType= $("#projectType").find("option:selected").attr("value");
		var zbPersonName = $('#zbPersonName').val();
		var zbCompanyName = $('#zbCompanyName').val();
		var pubCompanyName = $('#pubCompanyName').val();
		var jsondata = {
			projectName:projectName,
			projectType:projectType,
			zbPersonName:zbPersonName,
			zbCompanyName:zbCompanyName,
			pubCompanyName:pubCompanyName
		};

		table.reload('tableList', {where: jsondata});
	}

	layui.use('table', function () {
		table = layui.table;
		element = element;
		//方法级渲染
		tableIns = table.render({
			id: 'tableList',
			elem: '#tableList',
			url: '/supplier/gspubnotice/queryGsList',
			height: "auto",
			page: true,
			cols: [[
				{
					title: '序号', width: '6%', templet: function (res) {
						return res.LAY_INDEX;
					}
				},
				{field: 'supProjectId', title: 'supProjectId', width: '10%', hide:true,sort: true},
				{field: 'projectName', title: '项目名称', width: '15%', sort: true,templet:function (d) {
						return '<span class="cursor" onclick="showDetail(\'' + d.supProjectId + '\',\'' + d.projectName + '\')">' + d.projectName + '</span>';
					}},
				{field: 'startDate', title: '发布单位', width: '20%', hide:true,sort: true},
				{field: 'endDate', title: '发布单位', width: '20%',hide:true, sort: true},
				{field: 'pubCompanyName', title: '发布单位', width: '20%', sort: true},
				{field: 'zbPersonName', title: '公示期', width: '20%', hide:true,sort: true},
				{field: 'gsq', title: '公示期', width: '20%', sort: true,templet: function (d) {
					       var str=d.startDate+"至"+d.endDate;
							return str;
					}},
				{field: 'gsStatus', title: '公示状态', width: '10%', sort: true,templet: function (d) {
						if(d.gsStatus=="0"){
							return "未公示";
						}
						if(d.gsStatus=="1"){
							return "公示中";
						}
						if(d.gsStatus=="2"){
							return "已结束";
						}
					}},
				{field: 'zbPersonName', title: '中标人', width: '10%', sort: true},
				{field: 'zbCompanyName', title: '中标单位', width: '20%', sort: true}
			]],
			done: function (res, currentCount) {
				//***重点***：table渲染完成后渲染element进度条
				element.render();
				$(".layui-table-page select").css("width","80px");

			}
		});
		//监听工具条
		table.on('tool(tableList)', function (obj) {
			var data = obj.data;
			var that = $(this);
			if(obj.event === 'resetPassword') {
				parent.layer.confirm('确定重置密码？', function (index) {
					var userId=data.userId;
					layerAjax("resetPassword", {id: userId}, "", function (d) {
						if (d.flag) {
							parent.layer.close(index);
							layer.msg("操作成功", {icon: 1});
							tableIns.reload();
						} else {
							layer.msg("操作失败", {icon: 2});
						}
					})
				});
			}
		});
	});
	function showDetail(id, projectName) {
		window.parent._showtab('xm_v' + id, '查看-' +projectName, '/supplier/projectManager/projectDetail?type=v&supProjectId=' +id);
	}
	function provinceChange(object){
		var code = $(object).find('option:selected').val();
		if (code == "") {
			return;
		}
		layerAjaxGet('/sys/register/getOrganize', {"code": code}, '', function (d) {
			if (d.flag == true) {
				$(object).next().empty().append("<option value=''>选择市</option>");
				for (var i = 0; i < d.data.length; i++) {
					$(object).next().append("<option value='" + d.data[i].code + "'>" + d.data[i].name + "</option>");
				}
			} else {
				layer.msg(d.msg, {icon: 2});
			}
		});


	};
	function cityChange (object){
		var code = $(object).find('option:selected').val();
		if (code == "") {
			return;
		}
		layerAjaxGet('/sys/register/getOrganize', {"code": code}, '', function (d) {
			if (d.flag == true) {
				$(object).next().empty().append("<option value=''>选择区县</option>");
				for (var i = 0; i < d.data.length; i++) {
					$(object).next().append("<option value='" + d.data[i].code + "'>" + d.data[i].name + "</option>");
				}
			} else {
				layer.msg(d.msg, {icon: 2});
			}
		});


	}
	function fbjggs (){

		alert(22);




	}



</script>
</body>

</html>
